<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${BaseContext }">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>checkMaterial JSP</title>
	<!-- 引入css -->
	<link rel="stylesheet" href="assets/css/amazeui.min.css">
	<link rel="stylesheet" href="assets/css/app.css">
	<!-- 引入JQuery  js-->
	<script src="static/js/jquery-3.2.1.min.js"></script>
	<script src="assets/js/amazeui.min.js"></script>
<style type="text/css">
th,td {
	text-align: center;
}
</style>
</head>
<body>
	<!-- 顶栏  -->
	<jsp:include page="include/top.jsp"></jsp:include>
	
	<div class="am-g">
	  <div class="am-u-sm-2">
	  	<!-- menu -->
	  	<jsp:include page="include/menu.jsp"></jsp:include>
	  </div>
		<div class="am-u-sm-10">
			<!-- 面板-->
			<div class="am-panel am-panel-default">
			  	<div class="am-panel-hd">
			  		<a href="professor/index.do">首页</a> / <a href="professor/assessMaterial.do">教师列表</a>
			  	</div>
			  	<div class="am-panel-bd">
			  		<!-- 翻页form -->
					<form id="hiddenForm" action="professor/assessMaterial.do" method="post">
						<input type="hidden" name="pageNum" id="pageNum">
					</form>
					<div class="am-container">
					  <div class="am-g">
					  	<c:if test="${empty pageInfo.list}">
					  		<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
								<tbody>
									<tr>
										<td align="center" class="am-noborder">
											<font style="font-size:15px;color:red">没有相关数据！</font>
										</td>
									</tr>
								</tbody>
							</table>
					  	</c:if>
					  	<c:if test="${not empty pageInfo.list}">
						    <table class="am-table am-table-bordered am-table-striped am-table-hover">
							    <thead>
							            <tr>
										<th>教师编号</th>
										<th>姓名</th>
										<th>性别</th>
										<th>出生年份</th>
										<th>邮箱</th>
										<th>学历</th>
										<th>职称</th>
										<th>状态</th>
										<th>操作</th>
						            </tr>
							    </thead>
							    <tbody>
							        <c:forEach  items="${pageInfo.list}" var="teacher">
									<tr>
										<td>${teacher.tId}</td>
										<td>${teacher.tName}</td>
										<td>
											<c:if test="${teacher.tSex==0 }">男</c:if>
											<c:if test="${teacher.tSex==1 }">女</c:if>
										</td>
										<td><fmt:formatDate value="${teacher.tBirth}" dateStyle="medium" /></td>
										<td>${teacher.tEmail }</td>
										<td>
											<c:if test="${teacher.tDgree==0 }">本科</c:if>
											<c:if test="${teacher.tDgree==1 }">硕士</c:if>
											<c:if test="${teacher.tDgree==2 }">博士</c:if>
										</td>
										<td>
											<c:if test="${teacher.tTitle==0 }">教师</c:if>
											<c:if test="${teacher.tTitle==1 }">助教</c:if>
											<c:if test="${teacher.tTitle==2 }">副教授</c:if>
											<c:if test="${teacher.tTitle==3 }">教授</c:if>
										</td>
										<td>
											<c:if test="${teacher.assessStatus==0 }">未评估</c:if>
											<c:if test="${teacher.assessStatus==1 }">评估中</c:if>
											<c:if test="${teacher.assessStatus==2 }">已评估</c:if>
										</td>
										<td>
											<button class="btn btn-default btn-xs btn-info" tname="${teacher.tName }" tid="${teacher.tId }" onClick="checkMaterial(this);">材料详情</button>
											<button class="btn btn-default btn-xs btn-info" tname="${teacher.tName }" tid="${teacher.tId }" onClick="checkSummary(this);">教师总结</button>
										</td>
									</tr>
								</c:forEach>
							    </tbody>
							</table>
							<!-- 页码 -->
							<jsp:include page="include/pageInfo.jsp"></jsp:include>
						</c:if>
					  </div>
					</div>
					
					<!-- 模态框 -->
					<div class="am-modal am-modal-no-btn" tabindex="-1" id="material-modal">
						<div class="am-modal-dialog">
							<div class="am-modal-hd" id="modal-title">
								教师材料
								<!-- 关闭按钮 -->
								<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
							</div>
							<div class="am-modal-bd" id="modal-content"></div>
						</div>
					</div>
					
				</div>
			</div>
		</div>
	</div>

	<!-- footer -->
	<jsp:include page="include/footer.jsp"></jsp:include>
</body>
<script type="text/javascript">
	/* 翻页按钮 */
    function goPage(page){
		$("#pageNum").val(page);
		$("#hiddenForm").submit();
	}
	/* 查看材料文件 */
	function checkMaterial(obj){
		var tId = $(obj).attr('tid');
		var tName = $(obj).attr('tname');
		$('#modal-title').html('教师： '+tName+' 的材料文件')
		//ajax加载指定教师的材料文件列表
		$('#modal-content').html('');
		$('#modal-content').load('professor/getMaterialDetail.do',{tId:tId});
		$('#material-modal').modal('toggle');	
	}	
	/* 查看教师总结 */
	function checkSummary(obj){
		var tId = $(obj).attr('tid');
		var tName = $(obj).attr('tname');
		$('#modal-title').html('教师： '+tName+' 的总结报告')
		//ajax加载指定教师的总结报告
		$('#modal-content').html('');
		$('#modal-content').load('professor/getSummaryDetail.do',{tId:tId});
		$('#material-modal').modal('toggle');
	}
</script>
</html>